<include file="__PUBLIC__/head.html"/>
<css file="__PUBLIC__/css/config.css"/>
<script type="text/javascript" src="__ROOT__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jqueryui.js"></script>
<script>
    $(function(){
        $( "#tab" ).tabs({selected:{$hd.get.tabid}});
        
        $("#pic_thumb").uploadify({
            height          : 30,
            buttonImage     : '__ROOT__/uploadify/button.jpg',
            swf             : '__ROOT__/uploadify/uploadify.swf',
            uploader        : '__CONTROL__/uploads/{$sonid}/{$cokval}',
            width           : 120,
            onUploadSuccess:function(file, data, response){
                eval("data="+data);
                if(data.msg=='error'){
                    alert("上传失败");return;
                }
                var str='<div>\
                <img src="__ROOT__/'+data.file+'" width="200" heigth="80"/></div>'
               $("#newimg").val(data.file)
               //$.post("__CONTROL__/delpic",{path:data.file})
               $(".pic").html("").append(str);
            }
        });
    })
</script>
<style>
    .pic{margin-top: 10px; border: solid 1px #cdcdcd;float: left;}
    td input{width: 490px;height: 30px;}
    td .tel{width: auto;height: auto;}
</style>
</head>
<body>
    <div id="tab">
        <ul id="tab_top">
            <li><a href="#tabs-1">基本信息配置</a></li>
            <li><a href="#tabs-2">网站配置</a></li>
        </ul>
        <form id="form1" action="__CONTROL__/update" method="post">
            <div id="tabs-1">
                <table class="table1">
                    <thead>
                        <tr>
                            <td align="center" width="120"><b>配置说明</b></td>
                            <td align="center"><b>配置值</b></td>
                            <td align="center" width="120"><b>配置项</b></td>
                        </tr>
                    </thead>
                    <tbody>
                    <list from="$code" name="$c">
                    <tr>
                        <td>{$c.conf_msg}</td>
                        <td>
                            <input type="hidden" name="conf[{$c.conf_id}][conf_id]" value="{$c.conf_id}"/>
                            <input name="conf[{$c.conf_id}][conf_value]" value="{$c.conf_value}"/>
                        </td>
                        <td>{$c.conf_title}</td>
                    </tr>
                    </list>
                    </tbody>
                </table>
                <div class="sub">
                    <input type="submit" value="修改">
                </div>
            </div>
        </form>
        <form id="from2" action="__CONTROL__/saveconfig" method="post">
            <div id="tabs-2">

                <table class="table1">
                    <thead>
                        <tr>
                            <td align="center" width="120"><b>配置说明</b></td>
                            <td align="center"><b>配置值</b></td>
                            <td align="center" width="150"><b>配置项</b></td>
                        </tr>
                    </thead>
                    <tbody>
                    <list from="$config" name="$c">

                    <if value="{$c.conf_title}=='WATER_ON'">
                        <tr>
                            <td>{$c.conf_msg}</td>
                            <td>
                                <input type="hidden" name="conf[{$c.conf_id}][conf_id]" value="{$c.conf_id}"/>
                                <label><input class="tel" type="radio" name="conf[{$c.conf_id}][conf_value]" value="1" <if value="{$c.conf_value==1}"> checked="checked"</if>> 开启</label>
                                <label><input class="tel" type="radio" name="conf[{$c.conf_id}][conf_value]" value="0" <if value="{$c.conf_value==0}"> checked="checked"</if>> 关闭</label>
                        </td>
                        <td>{$c.conf_title}</td>
                        </tr>

                        <else>
                            <if value="{$c.conf_title}=='WATER_IMG'">
                                <tr>
                                    <td>{$c.conf_msg}</td>
                                    <td>
                                        <input type="hidden" name="conf[{$c.conf_id}][conf_id]" value="{$c.conf_id}"/>
                                        <input id="newimg" type="hidden" name="conf[{$c.conf_id}][conf_value]" value="{$c.conf_value}"/>
                                        <input type="file" id="pic_thumb"/>
                                        <div class="pic">
                                            <img src="__ROOT__/{$c.conf_value}">
                                        </div>
                                    </td>
                                    <td>{$c.conf_title}</td>
                                </tr>
                                <else>
                                    <tr>
                                        <td>{$c.conf_msg}</td>
                                        <td>
                                            <input type="hidden" name="conf[{$c.conf_id}][conf_id]" value="{$c.conf_id}"/>
                                            <input name="conf[{$c.conf_id}][conf_value]" value="{$c.conf_value}"/>
                                        </td>
                                        <td>{$c.conf_title}</td>
                                    </tr>
                            </if>
                    </if>
                    </list>
                    </tbody>
                </table>
                <div class="sub">
                    <input type="submit" value="修改">
                </div>
            </div>
        </form>
    </div>
</body>
</html>